<p class="Paragraph">Line Input #FileNumber As Integer, Var As String <help:key-word value="Line" tag="kw66387_1" xmlns:help="http://openoffice.org/2000/help"/></p>
<p class="Paragraph">FileNumber: Number of the file from which data is ot be read. The file must have been opened in advance with the Open statement and the key word READ.</p>
<p class="Paragraph">var: The name of the variable used to store the result.</p>
<p class="Paragraph">With the <span class="T1">Line Input#</span> statement, you can read strings from an open file into a variable. String variables are read line-by-line up to the first carriage return (Asc=13) or linefeed (Asc=10). <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>Line end marks are not included in the resulting string.</p>
<p class="P2">Example:</p>
<p class="PropText">Sub ExampleWorkWithAFile</p>
<p class="PropText">Dim iNumber As Integer</p>
<p class="PropText">Dim sLine As String</p>
<p class="PropText">Dim aFile As String</p>
<p class="PropText">Dim sMsg as String</p>
<p class="PropText">aFile = "c:\data.txt"</p>
<p class="PropText"/>
<p class="PropText">iNumber = Freefile</p>
<p class="PropText">Open aFile For Output As #iNumber</p>
<p class="PropText">Print #iNumber, "This is a line of text"</p>
<p class="PropText">Print #iNumber, "This is another line of text"</p>
<p class="PropText">Close #iNumber</p>
<p class="PropText"/>
<p class="PropText">iNumber = Freefile</p>
<p class="PropText">Open aFile For Input As iNumber</p>